home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / MPW Interfaces & Libraries / RIncludes / siow.r < prev    next >
Encoding:
Text File  |  1992-01-29  |  7.1 KB  |  372 lines  |  [TEXT/MPS ]

  1. /*------------------------------------------------------------------------------
  2. #
  3. #    Apple Macintosh Developer Technical Support
  4. #
  5. #    MultiFinder-Aware Simple Input/Output Window
  6. #
  7. #    SIOW
  8. #
  9. #    Copyright:    © 1989-1991 by Apple Computer, Inc., all rights reserved.
  10. #
  11. ------------------------------------------------------------------------------*/
  12.  
  13. #include "systypes.r"
  14. #include "types.r"
  15.  
  16. #include "SIOW.h"
  17.  
  18. #ifndef CREATOR
  19.     #define CREATOR 'siow'
  20. #endif
  21.  
  22. #ifndef FCREATOR
  23.     #define FCREATOR 'MPS '
  24. #endif
  25.  
  26. type 'pzza' {
  27.     literal longint;
  28. };
  29.  
  30. resource 'pzza' (128, purgeable) {
  31.     FCREATOR;
  32. };
  33.  
  34. /* we use an MBAR resource to conveniently load all the menus */
  35.  
  36. resource 'MBAR' (__rMenuBar, preload) {
  37.     { __mApple, __mFile, __mEdit, __mFont /*, __mSize */};        /* five menus */
  38. };
  39.  
  40.  
  41. resource 'MENU' (__mApple, preload) {
  42.     __mApple, textMenuProc,
  43.     0b1111111111111111111111111111101,    /* disable dashed line, enable About and DAs */
  44.     enabled, apple,
  45.     {
  46.         "About S I O W\311",
  47.             noicon, nokey, nomark, plain;
  48.         "-",
  49.             noicon, nokey, nomark, plain
  50.     }
  51. };
  52.  
  53. resource 'MENU' (__mFile, preload) {
  54.     __mFile, textMenuProc,
  55.     0b000000000000000000000000000000,    /* enable Quit only, program enables others */
  56.     enabled, "File",
  57.     {
  58.         "New",
  59.             noicon, "N", nomark, plain;
  60.         "Open",
  61.             noicon, "O", nomark, plain;
  62.         "-",
  63.             noicon, nokey, nomark, plain;
  64.         "Close",
  65.             noicon, "W", nomark, plain;
  66.         "Save",
  67.             noicon, "S", nomark, plain;
  68.         "Save As\311",
  69.             noicon, nokey, nomark, plain;
  70.         "-",
  71.             noicon, nokey, nomark, plain;
  72.         "Page Setup\311",
  73.             noicon, nokey, nomark, plain;
  74.         "Print\311",
  75.             noicon, nokey, nomark, plain;
  76.         "-",
  77.             noicon, nokey, nomark, plain;
  78.         "Quit",
  79.             noicon, "Q", nomark, plain
  80.     }
  81. };
  82.  
  83. resource 'MENU' (__mEdit, preload) {
  84.     __mEdit, textMenuProc,
  85.     0b0000000000000000000000000000000,    /* disable everything, program does the enabling */
  86.     enabled, "Edit",
  87.      {
  88.         "Undo",
  89.             noicon, "Z", nomark, plain;
  90.         "-",
  91.             noicon, nokey, nomark, plain;
  92.         "Cut",
  93.             noicon, "X", nomark, plain;
  94.         "Copy",
  95.             noicon, "C", nomark, plain;
  96.         "Paste",
  97.             noicon, "V", nomark, plain;
  98.         "Clear",
  99.             noicon, nokey, nomark, plain
  100.     }
  101. };
  102.  
  103. resource 'MENU' (__mFont, preload) {
  104.     __mFont, textMenuProc,
  105.     0b1111111111111111111111111111111,    /* enable everything */
  106.     enabled, "Font",
  107.      {
  108.      }
  109. };
  110.  
  111. /* this ALRT and DITL are used as an About screen */
  112.  
  113. resource 'ALRT' (__rAboutAlert, purgeable) {
  114.     {66, 58, 344, 396}, __rAboutAlert, {
  115.         OK, visible, silent;
  116.         OK, visible, silent;
  117.         OK, visible, silent;
  118.         OK, visible, silent
  119.     };
  120. };
  121.  
  122. resource 'DITL' (__rAboutAlert, purgeable) {
  123.     {    /* array DITLarray: 8 elements */
  124.         /* [1] */
  125.         {233, 144, 253, 224},
  126.         Button {
  127.             enabled,
  128.             "OK"
  129.         },
  130.         /* [2] */
  131.         {8, 72, 23, 264},
  132.         StaticText {
  133.             disabled,
  134.             "Simple Input/Output Window"
  135.         },
  136.         /* [3] */
  137.         {56, 24, 71, 337},
  138.         StaticText {
  139.             disabled,
  140.             "Copyright ©Apple Computer, Inc. 1989-1990 "
  141.         },
  142.         /* [4] */
  143.         {80, 108, 96, 244},
  144.         StaticText {
  145.             disabled,
  146.             "Brought to you by..."
  147.         },
  148.         /* [5] */
  149.         {109, 132, 134, 229},
  150.         StaticText {
  151.             disabled,
  152.             "\"PZZA SLT\""
  153.         },
  154.         /* [6] */
  155.         {176, 56, 200, 289},
  156.         StaticText {
  157.             disabled,
  158.             "Roger, Russ, Landon, Ira & Munch"
  159.         },
  160.         /* [7] */
  161.         {152, 24, 170, 212},
  162.         StaticText {
  163.             disabled,
  164.             "Special Thanks to..."
  165.         },
  166.         /* [8] */
  167.         {32, 152, 47, 200},
  168.         StaticText {
  169.             disabled,
  170.             "(SIOW)"
  171.         }
  172.     }
  173. };
  174.  
  175. /* this ALRT and DITL are used as an error screen */
  176.  
  177. resource 'ALRT' (__rUserAlert, purgeable) {
  178.     {40, 20, 150, 260},
  179.     __rUserAlert,
  180.     { /* array: 4 elements */
  181.         /* [1] */
  182.         OK, visible, silent,
  183.         /* [2] */
  184.         OK, visible, silent,
  185.         /* [3] */
  186.         OK, visible, silent,
  187.         /* [4] */
  188.         OK, visible, silent
  189.     }
  190. };
  191.  
  192.  
  193. resource 'DITL' (__rUserAlert, purgeable) {
  194.     { /* array DITLarray: 3 elements */
  195.         /* [1] */
  196.         {80, 150, 100, 230},
  197.         Button {
  198.             enabled,
  199.             "OK"
  200.         },
  201.         /* [2] */
  202.         {10, 60, 60, 230},
  203.         StaticText {
  204.             disabled,
  205.             "Error. ^0."
  206.         },
  207.         /* [3] */
  208.         {8, 8, 40, 40},
  209.         Icon {
  210.             disabled,
  211.             2
  212.         }
  213.     }
  214. };
  215.  
  216.  
  217. #define WindowHeight     286
  218. #define WindowWidth        480
  219.  
  220. resource 'WIND' (__rDocWindow, preload, purgeable) {
  221.     {0, 0, WindowHeight, WindowWidth},
  222.     zoomDocProc, invisible, noGoAway, 0x0, "untitled"
  223. };
  224.  
  225. resource 'CNTL' (__rVScroll, preload, purgeable) {
  226.     {-1, WindowWidth-15, WindowHeight-14, WindowWidth+1},
  227.     0, invisible, 0, 0, scrollBarProc, 0, ""
  228. };
  229.  
  230. resource 'CNTL' (__rHScroll, preload, purgeable) {
  231.     {WindowHeight-15, -1, WindowHeight+1, WindowWidth-14},
  232.     0, invisible, 0, 0, scrollBarProc, 0, ""
  233. };
  234.  
  235. resource 'STR#' (__kErrStrings, purgeable) {
  236.     {
  237.     "You must run on 512Ke or later";
  238.     "Application Memory Size is too small";
  239.     "Not enough memory to run SIOW";
  240.     "Not enough memory to do Cut";
  241.     "Cannot do Cut";
  242.     "Cannot do Copy";
  243.     "Cannot exceed 32,000 characters with Paste";
  244.     "Not enough memory to do Paste";
  245.     "Cannot create window";
  246.     "Cannot exceed 32,000 characters";
  247.     "Cannot do Paste"
  248.     "Font not found"
  249.     }
  250. };
  251.  
  252. /* here is the quintessential MultiFinder friendliness device, the SIZE resource */
  253.  
  254. resource 'SIZE' (-1) {
  255.     dontSaveScreen,
  256.     acceptSuspendResumeEvents,
  257.     enableOptionSwitch,
  258.     canBackground,                /* we can background; we don't currently, but our sleep value */
  259.                                 /* guarantees we don't hog the Mac while we are in the background */
  260.     multiFinderAware,            /* this says we do our own activate/deactivate; don't fake us out */
  261.     backgroundAndForeground,    /* this is definitely not a background-only application! */
  262.     dontGetFrontClicks,            /* change this is if you want "do first click" behavior like the Finder */
  263.     ignoreChildDiedEvents,        /* essentially, I'm not a debugger (sub-launching) */
  264.     not32BitCompatible,            /* this app should not be run in 32-bit address space */
  265.     reserved,
  266.     reserved,
  267.     reserved,
  268.     reserved,
  269.     reserved,
  270.     reserved,
  271.     reserved,
  272.     __kPrefSize * 1024,
  273.     __kMinSize * 1024    
  274. };
  275.  
  276.  
  277. type CREATOR as 'STR ';
  278.  
  279.  
  280. resource CREATOR (0) {
  281.     "MultiFinder-Aware Simple Input/Output Window (SIOW)"
  282. };
  283.  
  284.  
  285. resource 'BNDL' (128) {
  286.     CREATOR,
  287.     0,
  288.     {
  289.         'ICN#',
  290.         {
  291.             0, 128
  292.         },
  293.         'FREF',
  294.         {
  295.             0, 128
  296.         }
  297.     }
  298. };
  299.  
  300.  
  301. resource 'FREF' (128) {
  302.     'APPL',
  303.     0,
  304.     ""
  305. };
  306.  
  307.  
  308. resource 'ICN#' (128) {
  309.     {    /* array: 2 elements */
  310.         /* [1] */
  311.         $"0000 0000 0000 0000 0010 4100 0010 2200"
  312.         $"0020 2200 0020 2100 0020 4100 0010 4200"
  313.         $"0010 4200 0010 2200 0020 2100 0020 0100"
  314.         $"00FF FF00 03FF FFE0 0791 03F0 0ED1 0E7C"
  315.         $"1C31 321C 380D C10E 3FFF FFFE 3003 C106"
  316.         $"380D 300E 1E31 0E3C 1FC1 01F8 07FF FFE0"
  317.         $"00FF FE00",
  318.         /* [2] */
  319.         $"0000 0000 0000 0000 0010 4100 0010 2200"
  320.         $"0020 2200 0020 2100 0020 4100 0010 4200"
  321.         $"0010 4200 0010 2200 0020 2100 0020 0100"
  322.         $"00FF FF00 03FF FFE0 07FF FFF0 0FFF FFFC"
  323.         $"1FFF FFFC 3FFF FFFE 3FFF FFFE 3FFF FFFE"
  324.         $"3FFF FFFE 1FFF FFFC 1FFF FFF8 07FF FFE0"
  325.         $"00FF FE00"
  326.     }
  327. };
  328.  
  329. resource 'ALRT' (__rSaveAlert, preload) {
  330.     {72, 64, 212, 372},
  331.     __rSaveAlert,
  332.     {    /* array: 4 elements */
  333.         /* [1] */
  334.         OK, visible, silent,
  335.         /* [2] */
  336.         OK, visible, silent,
  337.         /* [3] */
  338.         OK, visible, silent,
  339.         /* [4] */
  340.         OK, visible, silent
  341.     }
  342. };
  343.  
  344. resource 'DITL' (__rSaveAlert, preload) {
  345.     {    /* array DITLarray: 4 elements */
  346.         /* [1] */
  347.         {58, 25, 76, 99},
  348.         Button {
  349.             enabled,
  350.             "Yes"
  351.         },
  352.         /* [2] */
  353.         {86, 25, 104, 99},
  354.         Button {
  355.             enabled,
  356.             "No"
  357.         },
  358.         /* [3] */
  359.         {12, 20, 45, 277},
  360.         StaticText {
  361.             disabled,
  362.             "Save changes before closing?"
  363.         },
  364.         /* [4] */
  365.         {86, 195, 104, 269},
  366.         Button {
  367.             enabled,
  368.             "Cancel"
  369.         }
  370.     }
  371. };
  372.